<?php 
if(isset($_GET['cid'])) {
    $rs_resources =getContentDetails($_GET['cid']);
    $row_rs_resources = mysql_fetch_assoc($rs_resources);
    $totalRows_rs_resources = mysql_num_rows($rs_resources);
?>
<div id="ptitle">Adding Items to <?php echo $row_rs_resources["page_title"]; ?>
</div><form action="<?php echo $editFormAction; ?>" method="post" enctype="multipart/form-data" name="frmaddcontent" id="frmaddcontent">
    <table align="center">
        <tr>
            <td width="50%">
                <table>
                    <tr valign="baseline">
                        <td nowrap="nowrap" align="right">Keywords:</td>
                        <td><input type="text" name="keywords" value="" size="32" /></td>
                    </tr>
                    <tr valign="baseline">
                        <td nowrap="nowrap" align="right">Title:</td>
                        <td><input type="text" name="ptitle" value="" size="32" /></td>
                    </tr>
                    <tr valign="baseline">
                        <td nowrap="nowrap" align="right">Source:</td>
                        <td><input type="text" name="source" value="" size="32" />
                        </td>
                    </tr>
                    <tr valign="baseline">
                        <td align="right" valign="top" nowrap="nowrap">Content:</td>
                        <td><textarea name="pcontent" cols="32" id="textarea2"></textarea> <script language="javascript1.2">
                            generate_wysiwyg('textarea2');
                            </script></td>
                    <tr valign="baseline">
                      <td>Show Page</td>
                      <td><label>
                        <select name="ispublished" id="ispublished">
                          <option value="yes">Yes</option>
                          <option value="no">No</option>
                        </select>
                      </label></td>
                    </tr>
                    <tr valign="baseline">
                        <td>Page Banner:</td>
                      
                                <td><?php
                                    $rs_resources1 =getSiteBanners();
                                    $row_rs_resources1 = mysql_fetch_assoc($rs_resources1);
                                    $totalRows_rs_resources1 = mysql_num_rows($rs_resources1);

                                    ?>

                                    <?php do { ?>

                                    <input type="radio" name="pbanner" value="<?php echo  $row_rs_resources1["resource_id"]; ?>" id="grp_<?php echo  $row_rs_resources1["resource_id"]; ?>"   />
                                    <a href="../resources/<?php echo $row_rs_resources1['resource_url']; ?>" rel="facebox" >
                                        <img name="" src="../resources/thump.php?im=<?php echo  $row_rs_resources1["resource_url"]; ?>" alt="" /></a>
                                        <?php }while($row_rs_resources1 = mysql_fetch_assoc($rs_resources1));?>
                                    <input type="radio" name="pbanner" value="" checked="checked" />None
                                </td>
                    </tr>

                    <?php
                    $cid= 0;

                    if(isset($_GET["cid"])) {
                        $cid= $_GET["cid"];
                    }
                    $r=getListType($cid);
                    $rr=mysql_fetch_assoc($r);
                    if($rr["list_type"]==3 ||$rr["list_type"]==2 ) { ?>
                    <tr valign="baseline">
                        <td> <?php
                                if($rr["list_type"]==3)
                                    echo "Starts On";
                                else
                                    echo "Date Created:";

                                ?></td>
                        <td>
                            <script>
                                var BASE='../';
                                var cdate =""
                                var yr = String( <?php echo ((int)date("Y"))?>);var d = String(<?php echo (date("d"));?>);var m= String(<?php echo (date("m"));?>);
                                cdate = yr+"-"+m+"-"+d;
                                DateInput('datecreated', true, 'YYYY-MM-DD',cdate)</script>
                                <?php ?>
                            <select name="tstartH" class="small">
                                    <?php  $h = date("H");
                                    $m = date("i");
                                    echo createComboList(24,$h);
                                    ?>
                            </select> Hr
                            <select name="tstartM"  class="small">
                                    <?php
                                    echo createComboList(60,$m);
                                    ?>
                            </select>Min
                            (Time eg 18:00)</td>
                    </tr>
                    <tr valign="baseline">
                        <td><input name="listtype" type="hidden" value="<?php echo $rr["list_type"]; ?>" /><?php
                                if($rr["list_type"]==3)
                                    echo "Ends On";
                                else
                                    echo "Last modified:";

                                ?>: </td>
                        <td>
                            <script>
                                var BASE='../';
                                var cdate =""
                                var yr = String( <?php echo ((int)date("Y"))?>);var d = String(<?php echo (date("d"));?>);var m= String(<?php echo (date("m"));?>);cdate = yr+"-"+m+"-"+d;
                                DateInput('lastmodified', true, 'YYYY-MM-DD',cdate)</script>
                            <select name="tendH" class="small">
                                    <?php  $h = date("H");
                                    $m = date("i");
                                    echo createComboList(24,$h);
                                    ?>
                            </select> Hr
                            <select name="tendM"  class="small">
                                    <?php
                                    echo createComboList(60,$m);
                                    ?>
                            </select>Min
                            (Time eg 18:00)</td>
                    </tr>
                        <?php } ?>
                    <tr valign="baseline">
                        <td colspan="2" align="right" valign="top" nowrap="nowrap"><input type="hidden" name="listtype" id="listtype" value="<?php echo $rr["list_type"]?>" />
                        </td>
                    </tr>

                    <tr valign="baseline">
                        <td nowrap="nowrap" align="right">&nbsp;</td>
                        <td><input type="submit" value="Insert record" /></td>
                    </tr>
                </table>
          <td>
            <td width="50%" valign="top">
                <table>
                    <tr valign="baseline">
                        <td nowrap="nowrap" align="right">
                            <input name="categoryid" type="hidden" id="categoryid" value="0<?php echo $cid; ?>" /></td>
                        <td><?php  $radioBtnName=""; $checked="";include("images.php"); ?>&nbsp;</td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <input type="hidden" name="MM_insert" value="frmContentAdd" />

</form>
<?php 
    include("similar_content.php");
}else
{
?>
<style type="text/css">
    #divdetails{display: none;}
</style>
    <?php }?>

